'use strict';

module.exports = app => {
  const { STRING, INTEGER, DATE } = app.Sequelize;

  return app.model.define('t_menu', {
    id: { type: INTEGER, primaryKey: true, autoIncrement: true },
    parentId: {
      type: INTEGER,
      field: 'parent_id',
    },
    menuName: {
      type: STRING(255),
      field: 'menu_name',
    },
    menuType: {
      type: STRING(255),
      field: 'menu_type',
    },
    buttonGroup: {
      type: STRING(255),
      field: 'button_group',
    },
    url: {
      type: STRING(255),
    },
    icon: {
      type: STRING(255),
    },
    logicDelete: {
      type: INTEGER,
      field: 'logic_delete',
      defaultValue: 0,
    },
    createdTime: {
      type: DATE,
      field: 'created_time',
      defaultValue: null,
    },
    updatedTime: {
      type: DATE,
      field: 'updated_time',
      defaultValue: null,
    },
  });
};
